package com.huangyi.order.api;


import com.huangyi.order.model.ProductInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(value = "product-service",path = "/product")
public interface ProductApi {
    @RequestMapping("/{id}")
    ProductInfo gerProductById(@PathVariable("id") Integer id);
    @RequestMapping("/p1")
    String returnId (@RequestParam("id") Integer id);
    @RequestMapping("/p2")
    String getNameAndId (@RequestParam("id") Integer id, @RequestParam("name") String name);
    @RequestMapping("/p3")
    String returnInfo (@SpringQueryMap ProductInfo productInfo);
    @RequestMapping("/p4")
    String returnInfoJson (@RequestBody ProductInfo productInfo);
}
